﻿using System;
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;

namespace Magalie.Data.NHibernateMaps.Conventions
{
    /// <summary>
    /// Convention de nommage des tables
    /// </summary>
    public class TableNameConvention : IClassConvention
    {
        /// <summary>
        /// Apply changes to the target
        /// </summary>
        public void Apply(IClassInstance instance)
        {
            instance.Table(Inflector.Net.Inflector.Pluralize(instance.EntityType.Name));
        }
    }
}